<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增逆向工程')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-engineering-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">所属系统：</label>
                <div class="col-sm-8">
                    <select name="sysId" class="form-control m-b" required>
                        <option th:each="mdSys : ${mdSysList}" th:text="${mdSys.sysName}" th:value="${mdSys.sysId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">jdbc驱动类：</label>
                <div class="col-sm-8">
                    <input name="jdbcDriver" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">jdbc连接串：</label>
                <div class="col-sm-8">
                    <input name="jdbcConnString" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">jdbc用户名：</label>
                <div class="col-sm-8">
                    <input name="jdbcUsername" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">jdbc密码：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input id="jdbcPassword" name="jdbcPassword" placeholder="请输入jdbc密码" class="form-control" type="text" required>
                        <span class="input-group-addon" title="鼠标按下显示密码"
                            onmousedown="$('#jdbcPassword').attr('type','text')"
                            onmouseup="$('#jdbcPassword').attr('type','password')"><i class="fa fa-key"></i></span>
                    </div>
                </div>
            </div>
        </form>
            <div class="form-group">   
             	<label class="col-sm-6"></label>
                <div class="col-sm-6">
                    <a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.testDb()"><i class="fa fa-edit"></i>连接测试</a>
                </div>
            </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "metadata/engineering"
        $("#form-engineering-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-engineering-add').serialize());
            }
        }
		function testDb(){
            if ($.validate.form()) {
                $.operate.save(prefix + "/testdb", $('#form-engineering-add').serialize());
            }
		}
    </script>
</body>
</html>